home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
XLisp-Stat
/
Book
/
resize.lsp
< prev
next >
Wrap
Text File
|
1990-10-11
|
737b
|
25 lines
; book pp.247-248
(setf w (send graph-window-proto :new))
(send w :draw-symbol 'disk t (/ (send w :canvas-width) 2) (/ (send w :canvas-height) 2))
(send w :add-slot 'x (/ (send w :canvas-width) 2))
(send w :add-slot 'y (/ (send w :canvas-height) 2))
(defmeth w :x (&optional (val nil set))
(if set (setf (slot-value 'x) val))
(slot-value 'x))
(defmeth w :y (&optional (val nil set))
(if set (setf (slot-value 'y) val))
(slot-value 'y))
(defmeth w :resize ()
(send self :x (/ (send self :canvas-width) 2))
(send self :y (/ (send self :canvas-height) 2)))
(defmeth w :redraw ()
(let ((x (round (send self :x)))
(y (round (send self :y))))
(send self :erase-window)
(send self :draw-symbol 'disk t x y)))